<template>
    <div>
        <van-nav-bar :fixed='true' left-arrow @click-left="onClickLeft" >
            <van-icon name="arrow-left" slot="left" />
        </van-nav-bar>
        <div class="add">
            <van-icon name="user-circle-o" size="80px" color="#ccc" />
        </div>
<p class="phone">手机号注册</p>

<input type="text" placeholder="请输入注册手机号" v-model="username" class="ipts">
<input type="text" placeholder="请输入密码" v-model="password" class="ipts" >
<div @click="tap()" class="rbtn">
  确定
</div>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    name:'zcymfb',
    data(){
        return{
           username:'',
            password:''
        }
    },
    methods:{
        onClickLeft() {
            this.$router.go(-1)
    },
        tap(){
            
              axios({
                method: "get",
                url:"http://jx.xuzhixiang.top/ap/api/reg.php",
                params:{username:this.username,password:this.password} 
                }).then(data => {
                     console.log(data);
                     if(data.data.code==1){
                        this.$router.push('/zcsrymfb')
                     }else{
                         alert('用户名已存在')
                     }
                });  
   
        }
    },
    mounted(){
       
    }
}
</script>
<style scoped>
.add{
    width: 105px;
    height: 105px;
    margin:46px auto  0;
}

.van-icon, .van-icon::before {
    display: inline-block;
    margin: 4px auto;
}
.phone{
   
width: 135px;
height: 25px;
color: rgba(16, 16, 16, 1);
font-size: 18px;
margin:30px 0 30px 120px;
}
.ipts{
    width: 280px;
    height: 50px;
    text-align: center;
    margin-bottom: 20px
}
.rbtn{
    width: 280px;
    height: 50px;
    background:#26a2ff;
    color: #fff;
    line-height: 50px;
    font-size: 16px;
    margin:10px auto 0
}
</style>


